<template>
  <view class="bg-white containder">
    <t-header @back="navBack"> 详情 </t-header>

    <view class="p-44">
      <view class="mb-22">
        <text class="text-32 text-bold black">
          {{ title }}
        </text>
        <view class="time border-bottom">{{ createTime }}</view>
      </view>
      <text v-html="detail" class="black"></text>
    </view>
  </view>
</template>

<script setup>
  import { ref } from 'vue';
  import { onLoad } from '@dcloudio/uni-app';
  import { getNewsItemDetail } from '@/api/index.js';
  import THeader from '@/components/views/t-header/index.vue'; // 头部组件
  const detail = ref('');
  const createTime = ref('');
  const title = ref('');
  onLoad(async (t) => {
    const res = await getNewsItemDetail({
      id: t.id,
    });
    createTime.value = t.createtime;
    title.value = t.title;
    console.log(11111111, t, createTime.value);

    detail.value = res.data.detail;
  });

  const navBack = () => {
    uni.navigateBack();
  };
</script>

<style lang="scss" scoped>
  .mb-22 {
    margin-bottom: 22rpx;
  }
  .p-44 {
    padding: 0px 44rpx;
  }
  .containder {
    height: 100%;
  }
  .text-32 {
    font-size: 32rpx;
  }
  .text-bold {
    font-weight: bold;
  }
  .black {
    color: #000000;
  }
  .time {
    margin-top: 12rpx;
    color: #797979;
    line-height: 34rpx;
    font-size: 24rpx;
    padding-bottom: 22rpx;
  }
</style>
